﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class OAUpdatePwd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Form["password"] != null && Request.Form["Username"] != null)
        {
            string pwd = Request.Form["password"].ToString();
            string itcode = Request.Form["Username"].ToString();
            string sql = "update DS_UserInfo set UserPassWord='" + pwd + "' where ItCode='" + itcode + "'";
            int val = DAL.SqlHelper.ExecuteNonQuery(DAL.SqlHelper.connStr, CommandType.Text, sql);
            if (val > 0)
            {
                Page.RegisterClientScriptBlock("close", "<script>alert('密码修改成功！');window.close();</script>");
            }
            else
            {
                Page.RegisterClientScriptBlock("close", "<script>alert('密码修改未成功，请重试！');window.close();</script>");
            }
        }

    }
}
